package com.estore.dao;

import java.util.List;

import javax.sql.DataSource;

import com.estore.entity.AgentBanner;
import com.estore.entity.Agent_Product;
import com.estore.entity.Agent_Profile;
import com.estore.entity.Discount;
import com.estore.entity.ProductList;
import com.estore.entity.ShopInterface;
import com.estore.info.AgentProductInfo;
import com.estore.info.DiscountInfo;
import com.estore.info.ShopInfo;

public interface ShopDao {

	public void setDataSource(DataSource datasource);

	public boolean checkAgentAvail(Integer userID);

	public void regShop(ShopInfo info);

	public boolean checkAgentNameAvail(String agentName);

	public boolean checkEmailAvail(String email);

	public boolean checkPhoneNumberAvail(String phoneNumber);

	public ShopInfo getShopInfo(Integer userID);

	public void changeShopProfile(ShopInfo info);

	public void updateLogo(String logo, Integer agentID);

	public List<ShopInfo> listAllShop();

	public void saleProductByShop(AgentProductInfo info);

	public void newList(AgentProductInfo info);

	public boolean checkListAvail(Integer productID, Integer agentID);

	// get all productid by agentid

	public List<ProductList> getAllProductOfShop(Integer agentID);

	public Agent_Product getAgentProductInfo(Integer listID);

	public List<ProductList> listProductList(Integer productID);

	public Agent_Profile getAgentProfileSellingProduct(Integer agentID);

	// get all agent selling product with sellingprice increase
	public List<AgentProductInfo> getAgentsSellingProduct(Integer ProductID);

	// get lowest discount of product
	public DiscountInfo getLowestDiscount(Integer productID);
	
	// get lowest selling price of product
	public AgentProductInfo getLowestPrice(Integer productID);

	// get all agent
	public List<Agent_Profile> getAllAgent();

	public ShopInfo getShopInfoByAgentID(Integer agentID);

	public void setDefaultInterface(Integer agentID);

	public ShopInterface getShopInterface(Integer agentID);

	// get agentID by agentName (shopInterface)
	public Integer getAgentID(String agentName);

	// edit banner (website agentID == 0, shop agentID != 0)
	public void editBanner(ShopInterface shop);

	// edit CategoriesBar (website agentID == 0, shop agentID != 0)
	public void editCategoriesBar(ShopInterface shop);

	// edit ProductType (website agentID == 0, shop agentID != 0)
	public void editProductType(ShopInterface shop);
	
	// edit template (website agentID == 0, shop agentID != 0)
	public void editTemplate(ShopInterface shop);
	
	public List<AgentBanner> listAgentBanner(Integer agentID);
	
	public void deleteBanner(Integer agentID, String linkBanner);
	
	public void addShopBanner(Integer agentID, String linkBanner);
	
	public void setBannerTittle(AgentBanner banner);
	
	// get productlist by productID and agentID
	public ProductList getProductList(Integer productID, Integer agentID);
	
	// get productlist by listID
	public ProductList getProductList(Integer listID);
	
	// change agentProductInfo by shop
	public void changeProductInfo(AgentProductInfo info);
	
	// make discount
	public void makeDiscount(Discount discount);
	
	// edit discount
	public void editDiscount(Discount discount);
	
	// check discount available
	public boolean checkDiscountAvailable(Integer listID);
	
	// get discount by listid
	public Discount getDiscount(Integer listID);
	
	
	// get all product id have discount 
	public List<Integer> getListDiscountAvail();
	
	// get agent product where most discount by productID
	public AgentProductInfo getMostDiscountByProductID(Integer productID);
	
	// end discount
	public void endDiscount(Integer listID);
	
	// get agent profile by agentid
	public Agent_Profile getAgentProfile(Integer agentID);
	
	// get all selling price of a product by productid
	public List<AgentProductInfo> getAgentProductByProductID(Integer productID);
	
	// get all discount of a product by product id
	public List<Discount> getAllDiscountByProductID(Integer productID);
	
	// end a selling list
	public void endList(Integer listID);
	
	// get list agent profile for exactly name
	public List<Agent_Profile> ListExactlyAgentName(String agentName);
	
	// get list agent profile for full text search
	public List<Agent_Profile> ListSimilarAgentName(String agentName);
}
